package unit4;

public class Ex4_5_Test {
    public static void main(String[] args) {
        A2 a = new A2();
        a.setM(50);
        a.printa();
        B2 b = new B2();
        b.printb();
        b.printa();
        b.setM(60);
        b.printb();
        b.printa();
        a.printa();
    }
}
class A2 {
    int m = 5;
    public void setM(int i) {
        m = i;
    }
    void printa() {
        System.out.println("m=" + m);
    }
}
class B2 extends A2 {
    int m = 10;
    void printb() {
        super.m = super.m + 20;
        System.out.println("super.m=" + super.m + "  m=" + m);
    }
}
